from django.conf.urls import url

from channels.routing import ProtocolTypeRouter, URLRouter
# from channels.auth import AuthMiddlewareStack
from web_sockets.my_auth_middleware import MyAuthMiddleware
from web_sockets.consumers import Consumer
from channels.routing import URLRouter

# from chat.consumers import AdminChatConsumer, PublicChatConsumer
# from aprs_news.consumers import APRSNewsConsumer

application = ProtocolTypeRouter({

    # WebSocket chat handler
    "websocket": MyAuthMiddleware(
        URLRouter([
            url(r"^chat/$", Consumer),
        ])
    ),

    # Using the third-party project frequensgi, which provides an APRS protocol
    # "aprs": APRSNewsConsumer,

})
